This invention relates to communication between two JAVA processes on a single system without establishing a JAVA physical socket connection between the two processes.
JAVA is an object-oriented programming language and also a distributed run time environment. JAVA is designed to run on any platform and enables a network computing model for communication between two different platforms, that is, for example, between an OS2 platform and a WINDOWS platform wherein JAVA is implemented on both of the two machines. In communicating between the two machines, a JAVA physical socket connection is established over which objects are sent to and from each machine. Within a single JAVA system, interprocess communication also requires the establishment of a JAVA physical socket to communicate from one process to another. This invention provides a technique for communicating between processes on the same JAVA system without establishing a JAVA physical socket, thereby avoiding overhead and improving performance.
This invention establishes a virtual socket to pass data from one JAVA process to another by making use of the standard-in, standard-out function associated with the underlying platform, for example, the standard-in, standard-out associated with a UNIX platform. The standard input function is normally used by the operating system for executing an input such as from a keyboard, and the standard output is used to send data to the display screen. This invention utilizes standard-in, standard-out for JAVA interprocess communication.
In the invention the JAVA virtual machine at the server creates a thread to manage data received from a first process object which may be at a client or on the server. The thread spawns off a first copy of the JAVA virtual machine to create a second JAVA process object. To do this, the thread communicates between the two JAVA virtual machines at the server utilizing the standard-in and standard-out methods associated with the underlying platform instead of utilizing a JAVA physical socket. The first copy of the JAVA virtual machine creates a second JAVA process object to receive the instance variables and perform the function requested. In that manner, communication is established between the two JAVA process objects without utilizing a JAVA physical socket between the JAVA processes resident on the server.
The invention is especially useful in a client-server network environment where the first process object is at a client and sends data (instance variables) rather than objects over a JAVA physical socket to the server. The JAVA virtual machine at the server spawns off a connection thread and makes use of the standard-in, standard-out function to communicate with a first copy of the JAVA virtual machine also at the server. In that manner, data received from a client by a first JAVA process (JAVA virtual machine at the server) is passed to the second JAVA process (first copy of the JAVA virtual machine) for execution and the result data are passed back over the same connection. If the function requires non-JAVA code located in a non-JAVA process object, that code is loaded by the first copy of the JAVA virtual machine into the second JAVA process object. Where the non-JAVA process is built with non-reentrant code, the non-JAVA process can handle only one client at a time. This invention enables several clients to set up their own communication thread to their own copy of the JAVA virtual machine and the non-JAVA process object without requiring each client to establish their own interprocess JAVA physical socket.
The above mentioned and other features and objects of this invention and the manner of obtaining them will become more apparent, and the invention itself will best be understood by reference to the following description of embodiments of the invention taken in conjunction with the accompanying drawing, a description of which follows.